package myHomework;

import java.util.Scanner;

public class Work26 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i,j;
        int count=0;
        for(i=2;i<=n;i++)
        {
            //判断i是不是素数
            for(j=2;j<i;j++)
            {
                if(i%j==0)
                {
                    break;
                }
            }
            if(j==i){
                System.out.print(i+"  ");
                count++;
            }
        }
        System.out.println();
        System.out.println(count);
    }
}
